Skip to content

feat(builtins): implement file comparison test operators#267

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 25, 2026
Merged

feat(builtins): implement file comparison test operators#267
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Feb 25, 2026

Summary

  • Implement -nt (newer than), -ot (older than), and -ef (same file) test operators
  • Works in both [ ] test command and [[ ]] conditionals
  • Uses VFS metadata timestamps for -nt/-ot, canonical path comparison for -ef
  • Handles edge cases: nonexistent files, both nonexistent, same path

Test plan

  • cargo clippy --all-targets --all-features -- -D warnings passes
  • cargo test --all-features --test spec_tests bash_spec_tests passes
  • 10 new spec tests (Bash 981, Total 1399)
  • Tests marked bash_diff where timing-dependent

Implement -nt (newer than), -ot (older than), and -ef (same file)
operators for both [ ] test command and [[ ]] conditionals.

Uses VFS metadata timestamps for -nt/-ot and canonical path
comparison for -ef. 10 new spec tests.
@chaliy chaliy merged commit e3a6025 into main Feb 25, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants